import { UPDATE_AUTHORITY_PARAMS, DELETE_AUTHORITY_INFO, initialState } from "./types"

const mutations = {
  [UPDATE_AUTHORITY_PARAMS] (state, payload) {
    Object.keys(payload).forEach(key => {
      state[key] = payload[key]
    })
  },
  [DELETE_AUTHORITY_INFO] (state) {
    Object.assign(state, { ...initialState })
    // 这样会对state进行破坏
    // state = { ...initialState }
  }
}

export default mutations
